<!DOCTYPE html>
<!--首页-->
<html>
<head>
    <meta charset="UTF-8">
    <title>完美商城</title>
    <meta name="Description" content="完美商城">
    <meta name="Keywords" content="完美商城">
    <link rel="stylesheet" type="text/css" href="../userResource/css/productlist.css">
    <link rel="stylesheet" type="text/css" href="../userResource/css/list.css">
    <link rel="stylesheet" type="text/css" href="../userResource/css/login.css">
    <style>
        .otherPage {
            height: 100%;
            min-height: 100px;
            max-height: 1000px;
            width: 100%;
            margin-bottom: 100px;
        }

        .page {
            width: 100%;
        }
    </style>
</head>
<body style="text-align: left;">

<!--头部导入-->
<div id="header"></div>

<!-- 右侧悬浮条 -->
<div class="fixed_bar">
    <dl>
        <dd class="center">
            <a href="#" target="_blank" class="needLogin"><span></span></a>
            <p class="tip"><a href="#" class="needLogin">个人中心</a></p>
        </dd>
        <dd class="my_like">
            <a href="favorite.html" target="_blank" class="needLogin"><span></span></a>
            <p class="tip"><a href="#" class="needLogin">我的关注</a></p>
        </dd>
        <dd class="fixed_cart_tip">
            <a href="shoppingcart.html"><span><i></i>购物车<font class="cartNum">0</font></span></a>
        </dd>
        <dd class="online">
            <a href="#" target="_blank" class="needLogin"><span></span></a>
            <p class="tip"><a href="#" target="_blank" class="needLogin">在线客服</a></p>
        </dd>
    </dl>
    <p class="go_top" title="Scroll Back to Top" style="opacity: 0;"><a href="javascript:void(0)"><span></span></a></p>
</div>

<!-- 面包屑导航 -->
<div class="nav_bar">
    <div class="wrap">
        您现在的位置：
        <a href="index.html">首页</a>
        &gt; <a href="#" id="nav_bar_name">我的关注</a>
    </div>
</div>

<!-- 分类导航 -->
<div class="class_nav">
    <div class="wrap">
        <dl class="cf">
            <dt class="f_left">分类：</dt>
            <dd class="f_left">
                <a href="#" class="">全部</a>
                <a href="#" class="" id="class_nav_name"></a>
            </dd>
        </dl>
    </div>
</div>

<!-- 商品列表主体 -->
<div class="wrap">
    <div class="sequence">
        <a href="#" data-order="2" class="prices">价格<span></span></a>
    </div>
    <div class="cf list">
        <ul class="cf" id="cf">
        </ul>
    </div>
</div>

<!-- iframe -->
<div class="otherPage">
    <!--底部footer-->
    <iframe style="height: 550px" class="page" src="footer.html" scrolling="no" frameborder="no"></iframe>
</div>

<!--jquery-->
<script type="text/javascript" src="../vendors/jquery/dist/jquery.js"></script>
<!--自己的js文件-->
<script type="text/javascript" src="../vendors/myself/myself.js"></script>
<script type="text/javascript" src="../vendors/myself/init.js"></script>
<!-- 初始化加载页面 -->
<script type="text/javascript">
    $(function () {

        $('#header').load('header.html');

        $.ajax("/user/getLoginedUser", {
            type: "GET"
            , success: function (data) {
                if (data.code == 200) {
                    // 加载商品列表数据
                    $.ajax('/myarea/myCollection', {
                        type: 'post',
                        data: {uid: data.rows.uid},
                        success: function (data) {
                            $.each(data.rows, function (index, row) {
                                var div_product_item;
                                if ((index + 1) % 4 != 0) {
                                    div_product_item = $('<li class="product-item in"></li>');
                                } else {
                                    div_product_item = $('<li class="product-item in" style="margin-right:0;"></li>');
                                }
                                if (row.storenum == 0) div_product_item.append('<p class="identity null">售罄</p>');
                                var detailUrl = 'productDetail.html?pid=' + row.pid + '&cid=' + row.cid;
                                //color: #e90404
                                div_product_item.append('<a href="javascript:void(0)" style="color: #e90404;" data-pid="' + row.pid + '" class="needLogin like" data-num="' + row.pheart + '" onclick="javascript:parent.location.reload();"><span style="background-position: -145px 0"></span><font id="heartNum">' + row.pheart + '</font></a>')
                                div_product_item.append('<a href="' + detailUrl + '" target="_blank"><img' +
                                    '                        src="' + row.imgurl + '" alt="' + row.pname + '"' +
                                    '                        title="' + row.pname + '"></a>');
                                div_product_item.append('<p class="name ellipsis" title="' + row.pname + '" style="word-wrap: break-word; word-break: break-all;">' + row.pname + '</p>')
                                div_product_item.append('<p class="price">¥' + row.price + '</p>');
                                var div_product_star = $('<div class="add">' +
                                    '                    <a href="' + detailUrl + '" class="btn" target="_blank"><span></span>加入购物车</a>' +
                                    '                </div>');
                                div_product_star.prepend('<a class="star stars' + row.pstart + '" href="#"></a>');
                                div_product_item.append(div_product_star);
                                $('#cf').append(div_product_item);
                            });
                            initProductBtn();
                            initHear();
                        }
                    });
                }
            }
        });


    });
</script>
</body>
</html>